﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace DiscoveryLogic.DataServices.DataSources
{    
    public class BillPayee
    {
        #region Private Variables

            private string name;
            private string accNum;
            private bool isRecurring;
            private List<BillPayment> history = new List<BillPayment>();

        #endregion

        #region Constructor

            public BillPayee()
            {
            }

        

            public BillPayee(string PayeeName, string PayeeAccNum, bool Recurring)
            {
                name = PayeeName;
                accNum = PayeeAccNum;
                isRecurring = Recurring;
            }

            public BillPayee(string PayeeName, string PayeeAccNum, bool Recurring, List<BillPayment> history)
            {
                name = PayeeName;
                accNum = PayeeAccNum;
                isRecurring = Recurring;
                this.history = history;
            }

        #endregion

        #region Get/Set methods

            public string Name
            {
                get{ return name; }
                set{ name = value; }
            }

            public string AccountNumber
            {
                get{ return accNum; }
                set{ accNum = value;}
            }

            public bool IsRecurring
            {
                get{ return isRecurring; }
                set{ isRecurring = value; }
            }

            public List<BillPayment> History
            {
                get { return history; }
                set { history = value; }
            }

        #endregion

        #region Public Methods

            // Returns this Payee`s list of BillPayment objects
            public List<BillPayment> GetHistory()
            {   
                // Moved history creation into BillPaymentManager. Should reefactor to a property.
                return history;
            }

            // Used to return amount of last payment
            public double GetLastAmount()
            {
                // ASSUMPTION: last element in the history list is always the latest
                return history[history.Count - 1].getPaymentAmount();
            }

        #endregion
    }
}
